package kr.co.goodwilldd.framework.security.model;

import java.io.Serializable;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import kr.co.goodwilldd.framework.annotations.FieldMatch;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotEmpty;

/**
 * 사용자 등록 폼 
 * 
 * <pre>
 * TODO 해당 사이트에 맞게 수정해야함
 * </pre>
 * 
 * @author GoodwillDD (kr.goodwilldd@gmail.com)
 * 
 */
@FieldMatch.List({
		@FieldMatch(first = "password", second = "confirmPassword", firstDesc = "Password", secondDesc = "Password Check"),
		@FieldMatch(first = "email", second = "confirmEmail", firstDesc = "Email", secondDesc = "Email Check") })
public class UserRegistration implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -534236675613483092L;

	/* ID 겸 Email */
	@NotEmpty
	@NotNull
	@Size(min = 4, max = 50)
	@Email
	String email;

	@NotEmpty
	@NotNull
	@Size(min = 4, max = 50)
	@Email
	String confirmEmail;

	/* 실제 이름 */
	@NotEmpty
	@NotNull
	@Size(min = 1, max = 50)
	String username;

	@NotEmpty
	@NotNull
	@Size(min = 4, max = 50)
	String password;

	@NotEmpty
	@NotNull
	@Size(min = 4, max = 50)
	String confirmPassword;

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getConfirmPassword() {
		return confirmPassword;
	}

	public void setConfirmPassword(String confirmPassword) {
		this.confirmPassword = confirmPassword;
	}

	public String getConfirmEmail() {
		return confirmEmail;
	}

	public void setConfirmEmail(String confirmEmail) {
		this.confirmEmail = confirmEmail;
	}

	public String toString() {
		return ToStringBuilder.reflectionToString(this,
				ToStringStyle.MULTI_LINE_STYLE);
	}

}
